<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateQhSchoolsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('qh_schools', function (Blueprint $table) {
            $table->id();
            $table->string('name')->comment('名称');
            $table->string('province')->nullable()->comment('省份');
            $table->string('url')->nullable()->comment('网站');
            $table->string('type')->nullable()->comment('类型');
            $table->string('level')->nullable()->comment('办学层次');
            $table->string('bxType')->nullable()->comment('办学类型');
            $table->string('thumb')->nullable()->comment('封面图');
            $table->string('city')->nullable()->comment('所属省市');
            $table->string('address')->nullable()->comment('地址');
            $table->string('tel')->nullable()->comment('电话，逗号隔开');
            $table->string('email')->nullable()->comment('邮箱');
            $table->string('logo')->nullable()->comment('logo');
            $table->string('baoMingUrl')->nullable()->comment('报名链接');
            $table->string('chengJiUrl')->nullable()->comment('成绩链接');
            $table->string('fenShuUrl')->nullable()->comment('分数链接');
            $table->integer('createYear')->nullable()->comment('创建时间');
            $table->string('area')->nullable()->comment('占地面积');
            $table->string('jiaoYuTing')->nullable()->comment('所属教育厅');
            $table->string('detail')->nullable()->comment('描述');
            $table->string('tags')->nullable()->comment('标签，逗号隔开');
            $table->integer('readCount')->nullable(0)->comment('阅读次数');
            $table->text('images')->nullable()->comment('校园风光图片，逗号隔开');
            $table->timestamps();
        });

        DB::statement("ALTER TABLE qh_schools comment '学校'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('qh_schools');
    }
}
